{extend name="../apps/admin/view/public/base.html"/}
{block name="style"}
    {include file="../apps/admin/view/builder/style.html" /}
{/block}
{block name="main"}        
<div class="builder listbuilder-box">
    <!-- Tab导航 -->
    {notempty name="tab_nav"}
        <div class="builder-tabs">
            <div class="">
                <ul class="nav nav-tabs">
                    {volist name="tab_nav.tab_list" id="tab"}
                        <li class="{php}if($tab_nav['current_tab'] == $key) echo 'active';{/php}"><a href="{$tab.href}">{$tab.title}</a></li>
                    {/volist}
                </ul>
            </div>
        </div>
    {/notempty}
    <!-- 顶部工具栏按钮 -->

    <div class="builder-toolbar mt-10 mb-20">
        <div class="row">
         <div class="col-xs-12 col-sm-12 button-list clearfix">
            <!-- 工具栏按钮 -->
            {notempty name="head_button_list"}
                <!--<div class="form-group">-->
                {volist name="head_button_list" id="button"}
                    <a {present name="button.attribute" }{$button.attribute}{/present}>{$button.title}</a>&nbsp;
                {/volist}
               <!-- </div>-->
            {/notempty}
            {notempty name="selects"}
                <form id="selectForm" method="get" action="{$selectPostUrl||default=$default_url}" class="form-dont-clear-url-param form-inline ml-20">            
                    {volist name="selects" id="select"}
                    <div class="form-group">    
                        {notempty name="select.title"}
                            <label for="{$select['name']}"  class=" pr-0">{$select.title}:</label>          
                        {/notempty}

                        <select name="{$select['name']}" data-role="select_text" class="form-control pl-20">
                            {php}$list_builder_selected = input('get.'.$select['name']);{/php}

                            {volist name="select['arrvalue']" id="svo"}
                                {php}if(is_array($svo)):{/php}
                                    <option value="{$svo.id}" {eq name="svo.id" value="$list_builder_selected"}selected{/eq}>{$svo.value}</option>
                                {php}else:{/php}
                                    <option value="{$key}" {eq name="key" value="$list_builder_selected"}selected{/eq}>{$svo}</option>
                                {php}endif;{/php}
                            {/volist}
                        </select>
                        </div>
                    {/volist}
                </form>
            {/notempty}
                            
            {notempty name="search"}
            <!-- 搜索框 -->
                <div class="col-xs-12 col-sm-3 clearfix fr pr0">
                    <form class="form form-inline" method="get" action="{$search.url}">
                        <div class="form-group">
                            <div class="input-group search-form">
                                <input type="text" name="keyword" class="form-control search-input pull-right" value="{present name="_GET.keyword"}{$_GET.keyword}{/present}" placeholder="{$search.title}">
                                <span class="input-group-btn"><button type="button" class="btn btn-success search-btn"><i class="fa fa-search"></i></button></span>
                            </div>
                        </div>
                    </form>
                </div>
            {/notempty}

        </div>
        {notempty name="sub_title"}
            <div class="col-xs-12 col-sm-12">
                <span class="builder_sub_title bg-yellow disabled color-palette"><i class="fa fa-info-circle"></i> {$sub_title}</span>
            </div>
        {/notempty}
        {notempty name="tip"}
            <div class="col-xs-11 col-sm-11 header-tip">
                <p class="builder_sub_title color-palette">{$tip|default=""}</p>
            </div>
        {/notempty}
        </div><!--row-->
    </div>

    <!-- 数据列表 -->
    <div class="builder-container">
        <div class="row">
            <div class="builder-table col-sm-12">
                <table class="table table-responsive table-bordered table-hover dataTable">
                    <thead>
                        <tr>
                            <th width="50" class="checkbox-toggle"><input class="check-all" type="checkbox"><!-- <span class="checkbox-toggle" style="color:#ddd;font-size:23px;cursor:pointer;"><i class="fa fa-square-o"></i></span> --></th>
                            {volist name="table_column_list" id="column"}
                                <th {$column.extra_attr}>{$column.title}</th>
                            {/volist}
                        </tr>
                    </thead>
                    <tbody>
                        {volist name="table_data_list" id="data"}
                            <tr>
                                <td><input class="ids" type="checkbox" value="{$data[$table_data_list_key]|default=""}" name="ids[]"></td>
                                {volist name="table_column_list" id="column"}
                                    <td>{$data[$column['name']]}</td>
                                {/volist}
                            </tr>
                        {/volist}

                        {empty name="table_data_list"}
                            <tr class="builder-data-empty">
                                {php}$tdcolspan = count($table_column_list)+1;{/php}
                                <td class="text-center empty-info" colspan="{$tdcolspan}">
                                    <i class="fa fa-database"></i> 暂时没有数据<br>
                                </td>
                            </tr>
                        {/empty}
                    </tbody>
                </table>
                <!-- 列表底部按钮 -->
                {notempty name="foot_button_list"}
                    <!--<div class="form-group">-->
                    {volist name="foot_button_list" id="button"}
                        <a {$button.attribute}>{$button.title}</a>&nbsp;
                    {/volist}
                   <!-- </div>-->
                {/notempty}

                {notempty name="table_data_page"}
                    <div class="paginations">{$table_data_page}</div>
                {/notempty}

            </div>
            </div>
    </div>

    <!-- 额外功能代码 -->
    {$extra_html}
</div>

{/block}
{block name="script"}
    {include file="../apps/admin/view/builder/javascript.html" /}
{/block}